# Maintainer: Connor Behan <connor.behan@gmail.com>
# Contributor: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Christian Storm <Christian.Storm@gmx.DE>
# Contributor: James Rayner <james@archlinux.org>
# Contributor: Thayer Williams <thayer@archlinux.org>

pkgname=vbetool
pkgver=1.2.2
pkgrel=7
pkgdesc="Uses lrmi in order to run code from the video BIOS"
url="https://cgit.freedesktop.org/~airlied/vbetool/"
license=('GPL2')
arch=('loong64' 'x86_64')
depends=('zlib' 'libx86' 'libpciaccess')
makedepends=('pciutils' 'git')
_commit=8cf64e31ff27ac4e9daa17d9178ad7d8d652fd08
source=("git+git://people.freedesktop.org/~airlied/vbetool#commit=$_commit"
        'no_x86_check.patch')
md5sums=('SKIP'
         'f4abc1181c0cda966626cbe5872d678f')

prepare() {
  cd "$pkgname"
  patch -Np1 -i ../no_x86_check.patch
}

build() {
  cd "$pkgname"
  ./autogen.sh --prefix=/usr --sbindir=/usr/bin
  make LIBS=-lpci
}

package() {
  cd "$pkgname"
  make DESTDIR="${pkgdir}" install
}
